package org.dromara.common.model.enums.im;

/**
 * 聊天记录自动删除功能开启状态枚举
 */
public enum ChatRecordDeleteEnum {
    NOT_ENABLED(0, "未开启"),
    ENABLED(1, "已开启");

    private final int code;
    private final String name;

    ChatRecordDeleteEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public int getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static ChatRecordDeleteEnum getByCode(int code) {
        for (ChatRecordDeleteEnum status : values()) {
            if (status.getCode() == code) {
                return status;
            }
        }
        throw new IllegalArgumentException("No ChatRecordDelete status found with code: " + code);
    }
}
